//
//  CZD_GoodBillListCell.m
//  LogisticsSupplier
//
//  Created by 吕晶 on 2020/9/28.
//  Copyright © 2020 吕晶. All rights reserved.
//

#import "CZD_GoodBillListCell.h"

@interface CZD_GoodBillListCell ()

@property (nonatomic, strong) UIView *bgView;
@property (nonatomic, strong) UIImageView *iconImgView;
@property (nonatomic, strong) UILabel *titleLab;
@property (nonatomic, strong) UILabel *numLab;
@property (nonatomic, strong) UIImageView *arrowImgView;

@end

@implementation CZD_GoodBillListCell

+ (instancetype)CZD_GoodBillListCellWithTableView:(UITableView *)tableView {
    static NSString *cellID = @"CZD_GoodBillListCell";
    CZD_GoodBillListCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (cell == nil) {
        cell = [[CZD_GoodBillListCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
    }
    return cell;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.backgroundColor = Color_backgroundColor;
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        self.bgView = [[UIView alloc] initWithFrame:CGRectMake(15, 10, ScreenW - 30, 58)];
        self.bgView.layer.masksToBounds = YES;
        self.bgView.layer.cornerRadius = 4;
        self.bgView.backgroundColor = HexColor(0xffffff);
        [self.contentView addSubview:self.bgView];
        
        self.iconImgView = [[UIImageView alloc] initWithFrame:CGRectMake(15, 20, 18, 18)];
        [self.iconImgView setImage:[UIImage imageNamed:@"icon_caozuodan_goodlist_form"]];
        [self.bgView addSubview:self.iconImgView];
        
        self.titleLab = [[UILabel alloc] initWithFrame:CGRectMake(self.iconImgView.nim_right + 10, 13, self.bgView.nim_width - 15 - 24 - (self.iconImgView.nim_right + 10), 13)];
        self.titleLab.font = [UIFont systemFontOfSize:12];
        self.titleLab.textColor = HexColor(0x9C9DB3);
        self.titleLab.text = @"提货单号";
        [self.bgView addSubview:self.titleLab];
        
        self.numLab = [[UILabel alloc] initWithFrame:CGRectMake(self.iconImgView.nim_right + 10, self.titleLab.nim_bottom + 2, self.bgView.nim_width - 15 - 24 - (self.iconImgView.nim_right + 10), 17)];
        self.numLab.font = BoldFontOfSize(17);
        self.numLab.textColor = HexColor(0x2B2C44);
        [self.bgView addSubview:self.numLab];
        
        self.arrowImgView = [[UIImageView alloc] initWithFrame:CGRectMake(self.bgView.nim_width - 15 - 24, 17, 24, 24)];
        self.arrowImgView.image = [UIImage imageNamed:@"icon_caozuodan_goodlist_arrow_getinto"];
        [self.bgView addSubview:self.arrowImgView];
        
        self.height = self.bgView.nim_bottom;
    }
    return self;
}

-(void)setNum:(NSString *)num {
    _num = num;
    self.numLab.text = num;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
